class UserSession < Authlogic::Session::Base
  validate :check_if_banned

  private

  #Checks if the suer is banned before letting them log in.
  def check_if_banned
    errors.add(:base, "Your account is banned.") unless attempted_record && !attempted_record.banned?
  end

end
